<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动练习</title>
</head>
<style>
    * {
        padding: 0;
        margin: 0;
    }
    div {
        width: 500px;
        height: 500px;
        background-color: pink;
        margin: 0 auto;
        
    }
    p {
        width: 200px;
        height: 200px;
        background-color: red;
        float: left;
        margin-top: 50px;
        margin-left: 50px;
        }
</style>

<body>
    <div>
        <p></p>
    </div>
</body>

</html>